package service

import (
	"database/sql"
	"github.com/gogf/gf/database/gdb"
	"github.com/gogf/gf/frame/g"
)

// 根据表名获取该表全部数据
func ListAllByTableName(table string)(gdb.Result, error){
	db := g.DB()
	r, err := db.Table(table).All()
	if err != nil && err != sql.ErrNoRows {
		return nil, err
	}
	return r, nil
}
